import { InitArguments } from "maishu-admin";
// import { tokens } from "../../../../shop/client/user/services/service";

// let node_modules = "../../node_modules";
// requirejs.config({
//     paths: {
//         "maishu-haoyi-shop": `${node_modules}/maishu-haoyi-shop/`,
//     }
// })

export default function (args: InitArguments) {

    // let defaultMasterPageSetState = args.app.masterPages.default.setState;
    // type State = InitArguments["app"]["masterPages"]["default"]["state"];
    // args.app.masterPages.default.setState = function (state: State) {
    //     defaultMasterPageSetState.apply(args.app.masterPages.default, [state])
    // }


    // tokens.userToken.value = args.app.loginInfo.token;
    // args.app.loginInfo.
    // args.app.setModulePath("designer/*", "/designer/admin/modules/*.js");
    debugger
    requirejs.config({
        paths: {
            "share/common": "/shop/share/common",
            "admin/services": "/designer/admin/services",
            "admin/site": "/designer/admin/site",
            "admin/clipboard": "/designer/admin/clipboard",
            "admin/admin/controls": "/designer/admin/controls",
        }
    })
    args.app.setModulePath("shop/*", "/shop/admin/modules/*.js");
    args.app.setModulePath("designer/*", "/designer/admin/modules/*.js");
}